<?php

declare(strict_types=1);

namespace App\Ai\Model;

use App\System\Model\SystemUploadfile;
use Hyperf\Database\Model\Relations\HasOne;
use Mine\MineModel;

/**
 * @property int $id 主键
 * @property int $created_by
 * @property int $file_id
 * @property int $status
 * @property-read SystemUploadfile $file
 */
class AiKnowledgeFile extends MineModel
{
    public bool $timestamps = false;
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'ai_knowledge_file';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'created_by', 'file_id', 'status'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'created_by' => 'integer', 'file_id' => 'integer', 'status' => 'integer'];

    public function file(): HasOne
    {
        return $this->hasOne(SystemUploadfile::class, 'id', 'file_id');
    }
}
